<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="therapyDetail.title"/></title>
    <meta name="heading" content="<fmt:message key='therapyDetail.heading'/>"/>
    <meta name="menu" content="MainMenu"/>
</head>
<c:set var="buttons">
    <input type="button" onclick="location.href='javascript:history.go(-1);'"
        value="<fmt:message key="button.done"/>"/>
</c:set>

<c:out value="${buttons}" escapeXml="false"/>
  <c:forEach var="therapy" items="${therapyList}" >
    <table align="center" class="table" >
      <tbody>
      		<tr>
      			<td colspan="2"><hr size="8"></td>
      		</tr>
	        <tr>
	          <td width="20%"><fmt:message key="therapy.tdate"/></td>
	          <td><c:out value="${therapy.dateStr}"/></td>
	        </tr>
	        <tr>
	          <td><fmt:message key="therapy.synptom"/></td>
	          <td  style="line-height:20px;"><c:out value="${therapy.synptom}"/></td>
	        </tr>
	        <tr>
	          <td><fmt:message key="therapy.tonguepulse"/></td>
	          <td  style="line-height:20px;"><c:out value="${therapy.tonguepulse}"/></td>
	        </tr>
	        <tr>
	          <td><fmt:message key="therapy.formula"/></td>
	          <td  style="line-height:20px;"><c:out value="${therapy.formulaStr}" escapeXml="false"/></td>
	        </tr>
            <tr>
              <td><fmt:message key="therapy.dosage"/></td>
              <td style="line-height:20px;"><c:out value="${therapy.dosage}" /></td>
            </tr>	        
	        <tr>
	          <td><fmt:message key="feedBackDetail.heading"/></td>
	          <td  style="line-height:20px;">
	           <c:forEach var="feedback" items="${therapy.feedbacks}" >
	          	
		          <c:out value="${feedback.fdate}"/>
	 	          <c:choose>
		       		<c:when test="${feedback.author}">
		    			<c:out value="${feedback.doctor.name}"/>
		    		</c:when>
		    		<c:otherwise>
		    			<c:out value="${feedback.patient.name}"/>
		    		</c:otherwise>
		    	  </c:choose>				          
	 	          <c:choose>
		       		<c:when test="${feedback.isGood}">
		    			<img src="<c:url value="/images/good.gif"/>" class="icon"/>
		    		</c:when>
		    		<c:otherwise>
		    			<img src="<c:url value="/images/bad.gif"/>" class="icon"/>
		    		</c:otherwise>
	    		  </c:choose>
		          <c:out value="${feedback.contentStr}" escapeXml="false"/>
		         <br>
	          </c:forEach>
            </td>
	        </tr>
      </tbody>
    </table>
   </c:forEach>  
 